cmake_minimum_required(VERSION 3.7.2)
project(cpplua)

set(CMAKE_CXX_STANDARD 17)

include_directories(include)
include_directories(3rd)
add_subdirectory(3rd/fmt EXCLUDE_FROM_ALL)

find_package(nlohmann_json 3.11.2 REQUIRED)

add_library(cpplua SHARED
        src/core/lang/lexer.cpp
        src/core/lang/parser.cpp
        src/core/lang/keyword.cpp
        src/tool/symbol/table_type.cpp
        src/tool/symbol/function_type.cpp
        src/tool/symbol/scope.cpp
        src/tool/symbol/local_scope.cpp
        src/tool/symbol/symbol.cpp
        src/tool/symbol/symbol_type.cpp
        src/utils/lineinfo.cpp)

target_link_libraries(cpplua
        fmt-header-only
        PRIVATE nlohmann_json::nlohmann_json)
